#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include "String.h"
using namespace mystring;

//void printstring(const string& s)
//{
//	string::cosnt_iterator it = s.begin();
//	while (it != s.end())
//	{
//		printf("%c", *it);
//		it++;
//	}
//}


int main()
{
	string s1;
	std::string s2;
	s1.Resize(20, 'x');
	for (auto ch : s1)
	{
		std::cout << ch << " ";
	}
	/*s1.PsuhBack('c');
	s1.PsuhBack('c');
	s1.PsuhBack('c');
	s1.PsuhBack('c');
	s1.PsuhBack('c');
	s1.PsuhBack('c');*/
	/*s2.push_back('c');
	s2.push_back('c');
	s2.push_back('c');
	s2.push_back('c');
	s2.push_back('c');
	s2.push_back('c');*/
	//string s2("hello nih");

	//string::iterator it = s1.begin();
	/*for (size_t i = 0; i < s1.size(); i++)
	{
		printf("%c",s1[i]);
	}*/
	/*while (it != s1.end())
	{
		printf("%c", *it);
		it++;
	}*/
	//s1 += 'a';
	//s1 += 'b';
	// += 'c';

	/*s1.Insert(0, 'y');
	s1.Insert(0, 'x');
	s1.Insert(2, "hello");*/
	//s1.Insert(2, "hello");
	//s1.reserve();
	//s1.Erase(2,1);
	//s1.resize(10, 'x');
	//printf("%zd\n", s1.Find('b'));
	//printf("%zd\n", s2.find('b'));

	/*s2 += '\0';
	s2 += " www.nihao";
	s2.clear();*/
	//s1 += '\0';
	//s1 += " www.he";
	//std::cin >> s1;
	//std::cin >> s2;

	//string s2("world");
	//s2 = s1;
	//printf("size = %d\n capacity = %d\n%s\n", s1.size(), s1.capacity(), s1.c_str());
	//s1.Resize(8, 'x');
	//printf("size = %d\n capacity = %d\n%s\n", s1.size(), s1.capacity(), s1.c_str());
	//std::cout << s1;
	/*printf("size = %d\n capacity = %d\n%s\n", s2.size(), s2.capacity(), s2.c_str());
	s2.resize(8, 'x');
	printf("size = %d\n capacity = %d\n%s\n", s2.size(), s2.capacity(), s2.c_str());
	std::cout << s2;*/

	//printf("s1 = s2 %d", s1 >= s2);
	//printstring(s1);
	/*int* p = nullptr;*/
	
	/*for (int i = 1; i < 20; i++)
	{
		s2.push_back('xxx');
		std::cout<<s2.capacity()<<"\n";
	}*/
	//std::cout << s2;
	/*std::cout << p;*/
	
	/*int ary[10] = {0};
	memset(ary, 4, 2 * sizeof(int));
	for (auto ch : ary)
	{
		std::cout << ch << std::endl;
	}*/
	return 0;
}
